package com.alibaba.algo.cooperation.usercomponent.service.user;

import com.alibaba.algo.cooperation.common.BaseResult;
import com.alibaba.algo.cooperation.usercomponent.vo.req.user.*;
import com.alibaba.algo.cooperation.usercomponent.vo.res.user.SelectRoleDetailByIdResponseVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 类SysRoleService.java的实现描述：角色 service
 *
 * @author nieganggang 2021-03-12 16:08:17
 */
@FeignClient(url="${feign.userCenterUrl:}", value = "usercenter-service", contextId = "usercenter-app")
public interface SysRoleService {

    @RequestMapping(value = "/sysRole/insert", method = RequestMethod.POST)
    BaseResult insert(@RequestBody CreateRoleRequestVO createRoleRequestVO);

    @RequestMapping(value = "/sysRole/insertOrgRole", method = RequestMethod.POST)
    BaseResult insertOrgRole(@RequestBody CreateRoleRequestVO createRoleRequestVO);

    @RequestMapping(value = "/sysRole/delete", method = RequestMethod.POST)
    BaseResult delete(@RequestBody List<Long> roleIdList);

    @RequestMapping(value = "/sysRole/update", method = RequestMethod.POST)
    BaseResult update(@RequestBody UpdateRoleRequestVO updateRoleRequestVO);

    /**
     * 只更新角色基本信息
     * @param updateRoleRequestVO
     * @return
     */
    @RequestMapping(value = "/sysRole/updateRoleBasicInfo", method = RequestMethod.POST)
    BaseResult updateRoleBasicInfo(@RequestBody UpdateRoleRequestVO updateRoleRequestVO);

    /**
     * 更新角色下的授权用户（只更新 或者只删除）
     * @param updateRoleRequestVO
     * @return
     */
    @RequestMapping(value = "/sysRole/updateRoleUser", method = RequestMethod.POST)
    BaseResult updateRoleUser(@RequestBody UpdateRoleRequestVO updateRoleRequestVO,@RequestParam(name="flag",defaultValue = "0")int flag);

    @RequestMapping(value = "/sysRole/updateOrgRole", method = RequestMethod.POST)
    BaseResult updateOrgRole(@RequestBody UpdateRoleRequestVO updateRoleRequestVO);

    @RequestMapping(value = "/sysRole/selectPage", method = RequestMethod.POST)
    BaseResult selectPage(@RequestBody SelectRoleListRequestVO selectRoleListRequestVO);

    @RequestMapping(value = "/sysRole/selectOrgRolePage", method = RequestMethod.POST)
    BaseResult selectOrgRolePage(@RequestBody SelectRoleListRequestVO selectRoleListRequestVO);

    @RequestMapping(value = "/sysRole/selectRoleListByKey", method = RequestMethod.POST)
    BaseResult selectRoleListByKey(@RequestBody SelectRoleDetailByCodeRequestVO vo);

    @RequestMapping(value = "/sysRole/selectDetailById", method = RequestMethod.POST)
    SelectRoleDetailByIdResponseVO selectDetailById(@RequestBody SelectRoleDetailByIdRequestVO vo);

    @RequestMapping(value = "/sysRole/selectOrgRoleDetailById", method = RequestMethod.POST)
    SelectRoleDetailByIdResponseVO selectOrgRoleDetailById(@RequestBody SelectRoleDetailByIdRequestVO vo);

    @RequestMapping(value = "/sysRole/selectList", method = RequestMethod.POST)
    BaseResult selectList(@RequestBody SelectRoleListByAppRequestVO vo);

    @RequestMapping(value = "/sysRole/updateUserRoleRelatedByOrgRole", method = RequestMethod.POST)
    BaseResult updateUserRoleRelatedByOrgRole();
}
